/********************************************************************
FileName    :   Dal_zwcl_xsrmxH.cs
CreateTime  :   2015-09-18 12:09
BaseClass   :   Dal_zwcl_xsrmxH
FileType    :   .cs
Author      :  minjie
Description :   Dal_zwcl_xsrmxHDAL层（简单三层）
*********************************************************************/

using System;
using System.Text;
using System.Data.SqlClient;
using System.Collections.Generic;

using System.Data;
namespace OS.DAL
{
	/// <summary>
	/// Dal_zwcl_xsrmxH的摘要说明。
	/// </summary>
	public partial class Dal_zwcl_xsrmxH 
  	{ 
     		      
  		public bool Exists(int DjLsh) 
  		{ 
  			StringBuilder strSql=new StringBuilder(); 
  			strSql.Append("select count(1) from zwcl_xsrmxH"); 
  			strSql.Append(" where "); 
           SqlParameter[] parameters = { new SqlParameter("@DjLsh", SqlDbType.Int,4)};  
  			return DbHelperSQL.Exists(strSql.ToString(),parameters); 
  		} 
  		 
  				 
  		 
  		/// <summary> 
  		/// 增加一条数据 
  		/// </summary> 
  		public  bool  Add(zwcl_xsrmxH_Entity model) 
  		{ 
  			StringBuilder strSql=new StringBuilder(); 
  			strSql.Append("insert into zwcl_xsrmxH(");			 
  	strSql.Append("DjLsh,DjBtZdh,DjFtZdh,DjStZdh,DjState,DjCount,gysbh,xsdh,xsrq,bmbh,bmmc,ckmc,ckbh,khbh,khmc,slhj,jehj,spbh,spmc,sptm,cjhh,flh,flmc,xsdj,xssl,zhje,hcbj) values ("); 
  	strSql.Append("	@DjLsh,@DjBtZdh,@DjFtZdh,@DjStZdh,@DjState,@DjCount,@gysbh,@xsdh,@xsrq,@bmbh,@bmmc,@ckmc,@ckbh,@khbh,@khmc,@slhj,@jehj,@spbh,@spmc,@sptm,@cjhh,@flh,@flmc,@xsdj,@xssl,@zhje,@hcbj	 ) "); 
  			SqlParameter[] parameters = { 
              new SqlParameter("@DjLsh", SqlDbType.Int,4) ,              
              new SqlParameter("@DjBtZdh", SqlDbType.Int,4) ,              
              new SqlParameter("@DjFtZdh", SqlDbType.Int,4) ,              
              new SqlParameter("@DjStZdh", SqlDbType.Int,4) ,              
              new SqlParameter("@DjState", SqlDbType.Char,10) ,              
              new SqlParameter("@DjCount", SqlDbType.Int,4) ,              
              new SqlParameter("@gysbh", SqlDbType.VarChar,50) ,              
              new SqlParameter("@xsdh", SqlDbType.VarChar,50) ,              
              new SqlParameter("@xsrq", SqlDbType.DateTime) ,              
              new SqlParameter("@bmbh", SqlDbType.VarChar,50) ,              
              new SqlParameter("@bmmc", SqlDbType.VarChar,50) ,              
              new SqlParameter("@ckmc", SqlDbType.VarChar,50) ,              
              new SqlParameter("@ckbh", SqlDbType.VarChar,50) ,              
              new SqlParameter("@khbh", SqlDbType.VarChar,50) ,              
              new SqlParameter("@khmc", SqlDbType.VarChar,50) ,              
              new SqlParameter("@slhj", SqlDbType.Decimal,9) ,              
              new SqlParameter("@jehj", SqlDbType.Decimal,9) ,              
              new SqlParameter("@spbh", SqlDbType.VarChar,50) ,              
              new SqlParameter("@spmc", SqlDbType.VarChar,50) ,              
              new SqlParameter("@sptm", SqlDbType.VarChar,50) ,              
              new SqlParameter("@cjhh", SqlDbType.VarChar,50) ,              
              new SqlParameter("@flh", SqlDbType.VarChar,50) ,              
              new SqlParameter("@flmc", SqlDbType.VarChar,50) ,              
              new SqlParameter("@xsdj", SqlDbType.Decimal,9) ,              
              new SqlParameter("@xssl", SqlDbType.Decimal,9) ,              
              new SqlParameter("@zhje", SqlDbType.Decimal,9) ,              
              new SqlParameter("@hcbj", SqlDbType.VarChar,50)};             
              parameters[0].Value = model.DjLsh;  
              
              parameters[1].Value = model.DjBtZdh;  
              
              parameters[2].Value = model.DjFtZdh;  
              
              parameters[3].Value = model.DjStZdh;  
              
           if (model.DjState != null)  
              parameters[4].Value = model.DjState;  
           else  
              parameters[4].Value = DBNull.Value;  
              
              parameters[5].Value = model.DjCount;  
              
           if (model.gysbh != null)  
              parameters[6].Value = model.gysbh;  
           else  
              parameters[6].Value = DBNull.Value;  
              
           if (model.xsdh != null)  
              parameters[7].Value = model.xsdh;  
           else  
              parameters[7].Value = DBNull.Value;  
              
           if (model.xsrq != null)  
              parameters[8].Value = model.xsrq;  
           else  
              parameters[8].Value = DBNull.Value;  
              
           if (model.bmbh != null)  
              parameters[9].Value = model.bmbh;  
           else  
              parameters[9].Value = DBNull.Value;  
              
           if (model.bmmc != null)  
              parameters[10].Value = model.bmmc;  
           else  
              parameters[10].Value = DBNull.Value;  
              
           if (model.ckmc != null)  
              parameters[11].Value = model.ckmc;  
           else  
              parameters[11].Value = DBNull.Value;  
              
           if (model.ckbh != null)  
              parameters[12].Value = model.ckbh;  
           else  
              parameters[12].Value = DBNull.Value;  
              
           if (model.khbh != null)  
              parameters[13].Value = model.khbh;  
           else  
              parameters[13].Value = DBNull.Value;  
              
           if (model.khmc != null)  
              parameters[14].Value = model.khmc;  
           else  
              parameters[14].Value = DBNull.Value;  
              
           if (model.slhj != null)  
              parameters[15].Value = model.slhj;  
           else  
              parameters[15].Value = DBNull.Value;  
              
           if (model.jehj != null)  
              parameters[16].Value = model.jehj;  
           else  
              parameters[16].Value = DBNull.Value;  
              
           if (model.spbh != null)  
              parameters[17].Value = model.spbh;  
           else  
              parameters[17].Value = DBNull.Value;  
              
           if (model.spmc != null)  
              parameters[18].Value = model.spmc;  
           else  
              parameters[18].Value = DBNull.Value;  
              
           if (model.sptm != null)  
              parameters[19].Value = model.sptm;  
           else  
              parameters[19].Value = DBNull.Value;  
              
           if (model.cjhh != null)  
              parameters[20].Value = model.cjhh;  
           else  
              parameters[20].Value = DBNull.Value;  
              
           if (model.flh != null)  
              parameters[21].Value = model.flh;  
           else  
              parameters[21].Value = DBNull.Value;  
              
           if (model.flmc != null)  
              parameters[22].Value = model.flmc;  
           else  
              parameters[22].Value = DBNull.Value;  
              
           if (model.xsdj != null)  
              parameters[23].Value = model.xsdj;  
           else  
              parameters[23].Value = DBNull.Value;  
              
           if (model.xssl != null)  
              parameters[24].Value = model.xssl;  
           else  
              parameters[24].Value = DBNull.Value;  
              
           if (model.zhje != null)  
              parameters[25].Value = model.zhje;  
           else  
              parameters[25].Value = DBNull.Value;  
              
           if (model.hcbj != null)  
              parameters[26].Value = model.hcbj;  
           else  
              parameters[26].Value = DBNull.Value;  
              
  			int rows=DbHelperSQL.ExecuteSql(strSql.ToString(),parameters);			 
  			if (rows > 0) 
  			{ 
  				return true; 
  			} 
  			else 
  			{ 
              return false;; 
           }  
  		} 
  		 
  		/// <summary> 
  		/// 增加一条数据(字符串) 
  		/// </summary> 
  		public  string  AddStr(zwcl_xsrmxH_Entity model) 
  		{ 
  				if(model.DjLsh==null) 
  				{ 
  					model.DjLsh=0; 
  				} 
  				if(model.DjBtZdh==null) 
  				{ 
  					model.DjBtZdh=0; 
  				} 
  				if(model.DjFtZdh==null) 
  				{ 
  					model.DjFtZdh=0; 
  				} 
  				if(model.DjStZdh==null) 
  				{ 
  					model.DjStZdh=0; 
  				} 
  				if(model.DjState==null) 
  				{ 
  					model.DjState="";  
  				} 
  				if(model.DjCount==null) 
  				{ 
  					model.DjCount=0; 
  				} 
  				if(model.gysbh==null) 
  				{ 
  					model.gysbh="";  
  				} 
  				if(model.xsdh==null) 
  				{ 
  					model.xsdh="";  
  				} 
  				if(model.bmbh==null) 
  				{ 
  					model.bmbh="";  
  				} 
  				if(model.bmmc==null) 
  				{ 
  					model.bmmc="";  
  				} 
  				if(model.ckmc==null) 
  				{ 
  					model.ckmc="";  
  				} 
  				if(model.ckbh==null) 
  				{ 
  					model.ckbh="";  
  				} 
  				if(model.khbh==null) 
  				{ 
  					model.khbh="";  
  				} 
  				if(model.khmc==null) 
  				{ 
  					model.khmc="";  
  				} 
  				if(model.slhj==null) 
  				{ 
  					model.slhj=0; 
  				} 
  				if(model.jehj==null) 
  				{ 
  					model.jehj=0; 
  				} 
  				if(model.spbh==null) 
  				{ 
  					model.spbh="";  
  				} 
  				if(model.spmc==null) 
  				{ 
  					model.spmc="";  
  				} 
  				if(model.sptm==null) 
  				{ 
  					model.sptm="";  
  				} 
  				if(model.cjhh==null) 
  				{ 
  					model.cjhh="";  
  				} 
  				if(model.flh==null) 
  				{ 
  					model.flh="";  
  				} 
  				if(model.flmc==null) 
  				{ 
  					model.flmc="";  
  				} 
  				if(model.xsdj==null) 
  				{ 
  					model.xsdj=0; 
  				} 
  				if(model.xssl==null) 
  				{ 
  					model.xssl=0; 
  				} 
  				if(model.zhje==null) 
  				{ 
  					model.zhje=0; 
  				} 
  				if(model.hcbj==null) 
  				{ 
  					model.hcbj="";  
  				} 
  		 
  			StringBuilder strSql=new StringBuilder(); 
  			strSql.Append("insert into zwcl_xsrmxH(");			 
  	strSql.Append("DjLsh,DjBtZdh,DjFtZdh,DjStZdh,DjState,DjCount,gysbh,xsdh,xsrq,bmbh,bmmc,ckmc,ckbh,khbh,khmc,slhj,jehj,spbh,spmc,sptm,cjhh,flh,flmc,xsdj,xssl,zhje,hcbj) values ("); 
  	strSql.Append("	"+ model.DjLsh+","+ model.DjBtZdh+","+ model.DjFtZdh+","+ model.DjStZdh+",'"+ model.DjState+"',"+ model.DjCount+",'"+ model.gysbh+"','"+ model.xsdh+"','"+ model.xsrq+"','"+ model.bmbh+"','"+ model.bmmc+"','"+ model.ckmc+"','"+ model.ckbh+"','"+ model.khbh+"','"+ model.khmc+"',"+ model.slhj+","+ model.jehj+",'"+ model.spbh+"','"+ model.spmc+"','"+ model.sptm+"','"+ model.cjhh+"','"+ model.flh+"','"+ model.flmc+"',"+ model.xsdj+","+ model.xssl+","+ model.zhje+",'" +model.hcbj+"'	 ) "); 
           return strSql.ToString(); 
  		} 
  		 
  		 
  		/// <summary> 
  		/// 更新一条数据 
  		/// </summary> 
  		public bool Update(zwcl_xsrmxH_Entity model) 
  		{ 
  			StringBuilder strSql=new StringBuilder(); 
  			strSql.Append("update zwcl_xsrmxH set "); 
              strSql.Append(" DjLsh = @DjLsh,"); 
              strSql.Append(" DjBtZdh = @DjBtZdh,"); 
              strSql.Append(" DjFtZdh = @DjFtZdh,"); 
              strSql.Append(" DjStZdh = @DjStZdh,"); 
              strSql.Append(" DjState = @DjState,"); 
              strSql.Append(" DjCount = @DjCount,"); 
              strSql.Append(" gysbh = @gysbh,"); 
              strSql.Append(" xsdh = @xsdh,"); 
              strSql.Append(" xsrq = @xsrq,"); 
              strSql.Append(" bmbh = @bmbh,"); 
              strSql.Append(" bmmc = @bmmc,"); 
              strSql.Append(" ckmc = @ckmc,"); 
              strSql.Append(" ckbh = @ckbh,"); 
              strSql.Append(" khbh = @khbh,"); 
              strSql.Append(" khmc = @khmc,"); 
              strSql.Append(" slhj = @slhj,"); 
              strSql.Append(" jehj = @jehj,"); 
              strSql.Append(" spbh = @spbh,"); 
              strSql.Append(" spmc = @spmc,"); 
              strSql.Append(" sptm = @sptm,"); 
              strSql.Append(" cjhh = @cjhh,"); 
              strSql.Append(" flh = @flh,"); 
              strSql.Append(" flmc = @flmc,"); 
              strSql.Append(" xsdj = @xsdj,"); 
              strSql.Append(" xssl = @xssl,"); 
              strSql.Append(" zhje = @zhje,"); 
              strSql.Append(" hcbj = @hcbj"); 
  			strSql.Append(" where  DjLsh=@DjLsh "); 
  						 
  SqlParameter[] parameters = { 
              new SqlParameter("@DjLsh", SqlDbType.Int,4) ,              
              new SqlParameter("@DjBtZdh", SqlDbType.Int,4) ,              
              new SqlParameter("@DjFtZdh", SqlDbType.Int,4) ,              
              new SqlParameter("@DjStZdh", SqlDbType.Int,4) ,              
              new SqlParameter("@DjState", SqlDbType.Char,10) ,              
              new SqlParameter("@DjCount", SqlDbType.Int,4) ,              
              new SqlParameter("@gysbh", SqlDbType.VarChar,50) ,              
              new SqlParameter("@xsdh", SqlDbType.VarChar,50) ,              
              new SqlParameter("@xsrq", SqlDbType.DateTime) ,              
              new SqlParameter("@bmbh", SqlDbType.VarChar,50) ,              
              new SqlParameter("@bmmc", SqlDbType.VarChar,50) ,              
              new SqlParameter("@ckmc", SqlDbType.VarChar,50) ,              
              new SqlParameter("@ckbh", SqlDbType.VarChar,50) ,              
              new SqlParameter("@khbh", SqlDbType.VarChar,50) ,              
              new SqlParameter("@khmc", SqlDbType.VarChar,50) ,              
              new SqlParameter("@slhj", SqlDbType.Decimal,9) ,              
              new SqlParameter("@jehj", SqlDbType.Decimal,9) ,              
              new SqlParameter("@spbh", SqlDbType.VarChar,50) ,              
              new SqlParameter("@spmc", SqlDbType.VarChar,50) ,              
              new SqlParameter("@sptm", SqlDbType.VarChar,50) ,              
              new SqlParameter("@cjhh", SqlDbType.VarChar,50) ,              
              new SqlParameter("@flh", SqlDbType.VarChar,50) ,              
              new SqlParameter("@flmc", SqlDbType.VarChar,50) ,              
              new SqlParameter("@xsdj", SqlDbType.Decimal,9) ,              
              new SqlParameter("@xssl", SqlDbType.Decimal,9) ,              
              new SqlParameter("@zhje", SqlDbType.Decimal,9) ,              
              new SqlParameter("@hcbj", SqlDbType.VarChar,50)};             
              parameters[0].Value = model.DjLsh;  
              
              parameters[1].Value = model.DjBtZdh;  
              
              parameters[2].Value = model.DjFtZdh;  
              
              parameters[3].Value = model.DjStZdh;  
              
           if (model.DjState != null)  
              parameters[4].Value = model.DjState;  
           else  
              parameters[4].Value = DBNull.Value;  
              
              parameters[5].Value = model.DjCount;  
              
           if (model.gysbh != null)  
              parameters[6].Value = model.gysbh;  
           else  
              parameters[6].Value = DBNull.Value;  
              
           if (model.xsdh != null)  
              parameters[7].Value = model.xsdh;  
           else  
              parameters[7].Value = DBNull.Value;  
              
           if (model.xsrq != null)  
              parameters[8].Value = model.xsrq;  
           else  
              parameters[8].Value = DBNull.Value;  
              
           if (model.bmbh != null)  
              parameters[9].Value = model.bmbh;  
           else  
              parameters[9].Value = DBNull.Value;  
              
           if (model.bmmc != null)  
              parameters[10].Value = model.bmmc;  
           else  
              parameters[10].Value = DBNull.Value;  
              
           if (model.ckmc != null)  
              parameters[11].Value = model.ckmc;  
           else  
              parameters[11].Value = DBNull.Value;  
              
           if (model.ckbh != null)  
              parameters[12].Value = model.ckbh;  
           else  
              parameters[12].Value = DBNull.Value;  
              
           if (model.khbh != null)  
              parameters[13].Value = model.khbh;  
           else  
              parameters[13].Value = DBNull.Value;  
              
           if (model.khmc != null)  
              parameters[14].Value = model.khmc;  
           else  
              parameters[14].Value = DBNull.Value;  
              
           if (model.slhj != null)  
              parameters[15].Value = model.slhj;  
           else  
              parameters[15].Value = DBNull.Value;  
              
           if (model.jehj != null)  
              parameters[16].Value = model.jehj;  
           else  
              parameters[16].Value = DBNull.Value;  
              
           if (model.spbh != null)  
              parameters[17].Value = model.spbh;  
           else  
              parameters[17].Value = DBNull.Value;  
              
           if (model.spmc != null)  
              parameters[18].Value = model.spmc;  
           else  
              parameters[18].Value = DBNull.Value;  
              
           if (model.sptm != null)  
              parameters[19].Value = model.sptm;  
           else  
              parameters[19].Value = DBNull.Value;  
              
           if (model.cjhh != null)  
              parameters[20].Value = model.cjhh;  
           else  
              parameters[20].Value = DBNull.Value;  
              
           if (model.flh != null)  
              parameters[21].Value = model.flh;  
           else  
              parameters[21].Value = DBNull.Value;  
              
           if (model.flmc != null)  
              parameters[22].Value = model.flmc;  
           else  
              parameters[22].Value = DBNull.Value;  
              
           if (model.xsdj != null)  
              parameters[23].Value = model.xsdj;  
           else  
              parameters[23].Value = DBNull.Value;  
              
           if (model.xssl != null)  
              parameters[24].Value = model.xssl;  
           else  
              parameters[24].Value = DBNull.Value;  
              
           if (model.zhje != null)  
              parameters[25].Value = model.zhje;  
           else  
              parameters[25].Value = DBNull.Value;  
              
           if (model.hcbj != null)  
              parameters[26].Value = model.hcbj;  
           else  
              parameters[26].Value = DBNull.Value;  
              
              int rows=DbHelperSQL.ExecuteSql(strSql.ToString(),parameters); 
  			if (rows > 0) 
  			{ 
  				return true; 
  			} 
  			else 
  			{ 
  				return false; 
  			} 
  		} 
  		 
  		 
  		/// <summary> 
  		/// 删除一条数据 
  		/// </summary> 
  		public bool Delete(int  DjLsh) 
  		{ 
  			 
  			StringBuilder strSql=new StringBuilder(); 
  			strSql.Append("delete from zwcl_xsrmxH "); 
  			strSql.Append(" where  DjLsh=@DjLsh"); 
  			SqlParameter[] parameters = {  new SqlParameter("@DjLsh", SqlDbType.Int,4) };  
    parameters[0].Value = DjLsh;  
   
  			int rows=DbHelperSQL.ExecuteSql(strSql.ToString(),parameters); 
  			if (rows > 0) 
  			{ 
  				return true; 
  			} 
  			else 
  			{ 
  				return false; 
  			} 
  		} 
  		 
  		/// <summary> 
  		/// 批量删除一批数据 
  		/// </summary> 
  		public bool DeleteList(string DjLshlist ) 
  		{ 
  			StringBuilder strSql=new StringBuilder(); 
  			strSql.Append("delete from zwcl_xsrmxH "); 
  			strSql.Append(" where ID in ("+DjLshlist + ")  "); 
  			int rows=DbHelperSQL.ExecuteSql(strSql.ToString()); 
  			if (rows > 0) 
  			{ 
  				return true; 
  			} 
  			else 
  			{ 
  				return false; 
  			} 
  		} 
  		 
  		 
  		/// <summary> 
  		/// 得到一个对象实体 
  		/// </summary> 
  		public zwcl_xsrmxH_Entity GetModel(int   DjLsh) 
  		{ 
  			 
  			StringBuilder strSql=new StringBuilder(); 
  			strSql.Append("select  DjLsh,DjBtZdh,DjFtZdh,DjStZdh,DjState,DjCount,gysbh,xsdh,xsrq,bmbh,bmmc,ckmc,ckbh,khbh,khmc,slhj,jehj,spbh,spmc,sptm,cjhh,flh,flmc,xsdj,xssl,zhje,hcbj");	
		strSql.Append("  from zwcl_xsrmxH"); 
  			strSql.Append(" where  DjLsh=@DjLsh "); 
  			SqlParameter[] parameters = {  new SqlParameter("@DjLsh", SqlDbType.Int,4) };  
    parameters[0].Value = DjLsh;  
  			 
  			zwcl_xsrmxH_Entity model=new zwcl_xsrmxH_Entity(); 
  			DataSet ds=DbHelperSQL.Query(strSql.ToString(),parameters); 
  			 
  			if(ds!=null&&ds.Tables[0].Rows.Count>0) 
  			{ 
  		DataTable dt=ds.Tables[0];	  
  				if(dt.Rows[0]["DjLsh"]!=null&&dt.Rows[0]["DjLsh"].ToString()!="") 
  				{ 
  					model.DjLsh=int.Parse(dt.Rows[0]["DjLsh"].ToString()); 
  				} 
  				if(dt.Rows[0]["DjBtZdh"]!=null&&dt.Rows[0]["DjBtZdh"].ToString()!="") 
  				{ 
  					model.DjBtZdh=int.Parse(dt.Rows[0]["DjBtZdh"].ToString()); 
  				} 
  				if(dt.Rows[0]["DjFtZdh"]!=null&&dt.Rows[0]["DjFtZdh"].ToString()!="") 
  				{ 
  					model.DjFtZdh=int.Parse(dt.Rows[0]["DjFtZdh"].ToString()); 
  				} 
  				if(dt.Rows[0]["DjStZdh"]!=null&&dt.Rows[0]["DjStZdh"].ToString()!="") 
  				{ 
  					model.DjStZdh=int.Parse(dt.Rows[0]["DjStZdh"].ToString()); 
  				} 
  				model.DjState= dt.Rows[0]["DjState"].ToString(); 
  				if(dt.Rows[0]["DjCount"]!=null&&dt.Rows[0]["DjCount"].ToString()!="") 
  				{ 
  					model.DjCount=int.Parse(dt.Rows[0]["DjCount"].ToString()); 
  				} 
  				model.gysbh= dt.Rows[0]["gysbh"].ToString(); 
  				model.xsdh= dt.Rows[0]["xsdh"].ToString(); 
  				if(dt.Rows[0]["xsrq"]!=null&&dt.Rows[0]["xsrq"].ToString()!="") 
  				{ 
  					model.xsrq=DateTime.Parse(dt.Rows[0]["xsrq"].ToString()); 
  				} 
  				model.bmbh= dt.Rows[0]["bmbh"].ToString(); 
  				model.bmmc= dt.Rows[0]["bmmc"].ToString(); 
  				model.ckmc= dt.Rows[0]["ckmc"].ToString(); 
  				model.ckbh= dt.Rows[0]["ckbh"].ToString(); 
  				model.khbh= dt.Rows[0]["khbh"].ToString(); 
  				model.khmc= dt.Rows[0]["khmc"].ToString(); 
  				if(dt.Rows[0]["slhj"]!=null&&dt.Rows[0]["slhj"].ToString()!="") 
  				{ 
  					model.slhj=decimal.Parse(dt.Rows[0]["slhj"].ToString()); 
  				} 
  				if(dt.Rows[0]["jehj"]!=null&&dt.Rows[0]["jehj"].ToString()!="") 
  				{ 
  					model.jehj=decimal.Parse(dt.Rows[0]["jehj"].ToString()); 
  				} 
  				model.spbh= dt.Rows[0]["spbh"].ToString(); 
  				model.spmc= dt.Rows[0]["spmc"].ToString(); 
  				model.sptm= dt.Rows[0]["sptm"].ToString(); 
  				model.cjhh= dt.Rows[0]["cjhh"].ToString(); 
  				model.flh= dt.Rows[0]["flh"].ToString(); 
  				model.flmc= dt.Rows[0]["flmc"].ToString(); 
  				if(dt.Rows[0]["xsdj"]!=null&&dt.Rows[0]["xsdj"].ToString()!="") 
  				{ 
  					model.xsdj=decimal.Parse(dt.Rows[0]["xsdj"].ToString()); 
  				} 
  				if(dt.Rows[0]["xssl"]!=null&&dt.Rows[0]["xssl"].ToString()!="") 
  				{ 
  					model.xssl=decimal.Parse(dt.Rows[0]["xssl"].ToString()); 
  				} 
  				if(dt.Rows[0]["zhje"]!=null&&dt.Rows[0]["zhje"].ToString()!="") 
  				{ 
  					model.zhje=decimal.Parse(dt.Rows[0]["zhje"].ToString()); 
  				} 
  				model.hcbj= dt.Rows[0]["hcbj"].ToString(); 
  				return model; 
  			} 
  			else 
  			{ 
  				return null; 
  			} 
  		} 
  		 
  		/// <summary> 
  		/// 分页获取数据列表 
  		/// </summary> 
  		public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex) 
  		{ 
  			StringBuilder strSql=new StringBuilder(); 
  		 strSql.Append("SELECT * FROM ( "); 
  		 strSql.Append(" SELECT ROW_NUMBER() OVER ("); 
  if (!string.IsNullOrEmpty(orderby.Trim())) 
 { 
    strSql.Append("order by T." + orderby); 
 } 
else  
 { 
     strSql.Append("order by T.DjLsh desc"); 
 } 
		 strSql.Append(")AS Row, T.*  from zwcl_xsrmxH T "); 
  		 if (!string.IsNullOrEmpty(strWhere.Trim()))  
  			{ 
  			 strSql.Append(" WHERE " + strWhere); 
  			} 
  		    strSql.Append(" ) TT"); 
  	        strSql.AppendFormat(" WHERE TT.Row between {0} and {1}", startIndex, endIndex);			return DbHelperSQL.Query(strSql.ToString()); 
  		} 
  		 
  		 
  		/// <summary> 
  		/// 获得数据列表 
  		/// </summary> 
  		public DataSet GetList(string strWhere) 
  		{ 
  			StringBuilder strSql=new StringBuilder(); 
  			strSql.Append("select * "); 
  			strSql.Append(" FROM zwcl_xsrmxH "); 
  			if(strWhere.Trim()!="") 
  			{ 
  				strSql.Append(" where "+strWhere); 
  			} 
  			return DbHelperSQL.Query(strSql.ToString()); 
  		} 
  		 
  		/// <summary> 
  		/// 获得前几行数据 
  		/// </summary> 
  		public DataSet GetList(int Top,string strWhere,string filedOrder) 
  		{ 
  			StringBuilder strSql=new StringBuilder(); 
  			strSql.Append("select "); 
  			if(Top>0) 
  			{ 
  				strSql.Append(" top "+Top.ToString()); 
  			} 
  			strSql.Append(" * "); 
  			strSql.Append(" FROM zwcl_xsrmxH "); 
  			if(strWhere.Trim()!="") 
  			{ 
  				strSql.Append(" where "+strWhere); 
  			} 
  			strSql.Append(" order by " + filedOrder); 
  			return DbHelperSQL.Query(strSql.ToString()); 
  		} 
  		 
  		/// <summary> 
  		/// 获得记录条数 
  		/// </summary> 
  		public int GetRecordCount(string strWhere) 
  		{ 
  			StringBuilder strSql=new StringBuilder(); 
  			strSql.Append("select count(1) "); 
  			strSql.Append(" FROM zwcl_xsrmxH "); 
  			if(strWhere.Trim()!="") 
  			{ 
  				strSql.Append(" where "+strWhere); 
  			} 
  		   object obj=	DbHelperSQL.GetSingle(strSql.ToString()); 
  			if(obj!=null && obj.ToString()!="") 
  			{ 
              	return Convert.ToInt32(obj); 
  			} 
  			else 
  			return 0; 
  		} 
   
      
  	} 
  
}
